import re
def multiple_replace(text, adict):
     rx = re.compile('|'.join(map(re.escape, adict)))
     def one_xlat(match):
           return adict[match.group(0)]
     return rx.sub(one_xlat, text)

text = '123456'
adict={'1':'a','2':'b','3':'c','4':'d','5':'e','6':'f'}

print(multiple_replace(text, adict))